//只能是数字字母下划线
jQuery.validator.addMethod("stringCheck", function(value, element) {       
	   return this.optional(element) || /^[\u0391-\uFFE5\w]+$/.test(value);}, " "); 

//不能有特殊字符
jQuery.validator.addMethod("stringCheckAll", function(value, element) {       
	return this.optional(element) || /^[^<@]+$/.test(value);}, " "); 


//资源标识和权限标识验证(只能是字母和下划线)
jQuery.validator.addMethod("isResourcesName", function(value, element) {     
	var name = /^[A-Za-z]+_[A-Za-z]+$/;   
	return this.optional(element) || ( name.test(value)); }, ""); 

//资源地址 以.action结尾
jQuery.validator.addMethod("isResourcesAddres", function(value, element) {     
	var name = /^[A-Za-z\/!]*.action$/;   
	return this.optional(element) || ( name.test(value)); }, ""); 


//([A-Za-z] 只能是字母
//只能是数字
jQuery.validator.addMethod("isLetter", function(value, element) {     
	var mobile = /^[A-Za-z]*$/;   
	return this.optional(element) || ( mobile.test(value)); }, ""); 

//ip地址验证
jQuery.validator.addMethod("isIp", function(value, element) {     
	var ip = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;   
	return this.optional(element) || ( ip.test(value)); }, ""); 

//只能是数字
jQuery.validator.addMethod("isInteger", function(value, element) {     
	var mobile = /^[0-9]*$/;   
	return this.optional(element) || ( mobile.test(value)); }, ""); 

//邮政编码验证       
jQuery.validator.addMethod("isZipCode", function(value, element) {       
   var tel = /^[0-9]{6}$/;       
   return this.optional(element) || (tel.test(value));}, "请正确填写您的邮政编码");    

//联系电话(手机/电话皆可)验证   
jQuery.validator.addMethod("isPhone", function(value,element) {   
    var length = value.length;   
    var mobile = /^((1[0-9]{1})+\d{5})$/;   
    var tel = /^\d{3,4}-?\d{7,9}$/;   
    return this.optional(element) || (tel.test(value) || mobile.test(value)); }, "请正确填写您的联系电话");   

